<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <title>TimeStretch Filter</title>
   <link rel="stylesheet" type="text/css" href="../../avisynth.css">
</head>
<body >
<h2>
<a NAME="TimeStretch"></a>TimeStretch
</h2>
<p><code>TimeStretch </code>(<var>clip, float &quot;tempo&quot;, float
&quot;rate&quot;, float &quot;pitch&quot;</var>)
<p><code>TimeStretch</code> allows changing the sound <var>tempo</var>, <var>pitch</var>
and playback <var>rate</var> parameters independently from each other, i.e.:</p>
<ul>
  <li>Sound <var>tempo</var> can be increased or decreased while maintaining the
    original pitch.
  <li>Sound <var>pitch</var> can be increased or decreased while maintaining the
    original tempo.
  <li>Change playback <var>rate</var> that affects both tempo and pitch at the
    same time.
  <li>Choose any combination of tempo/pitch/rate.</li>
</ul>
<p><b>Parameters:</b></p>
<p>All parameters are percentages, and defaults to 100. If <var>tempo</var> is
200 it will play twice as fast - if it is 50, it will play at half the speed.
Adjusting <var>rate</var> is equivalent to using <a href="assumerate.htm">AssumeSampleRate</a>
and <a href="resampleaudio.htm">ResampleAudio</a>, but at very high quality.</p>
<p><b>Notes:</b></p>
<p>This is NOT a sampleexact plugin. If you use it, slight inaccuracies might
occur. Since we are dealing with float values rounding errors might occur -
especially on large samples. In general however inaccuracies should not exceed a
few milliseconds for movielength samples.</p>
<p>In case anyone wonders, all parameters of the SoundTouch library are at their
best settings, and SEQUENCE_MS, SEEKWINDOW_MS and OVERLAP_MS are at their
default values. For more information see the readme at the <a href="http://sky.prohosting.com/oparviai/soundtouch/README.html#3">[Soundtouch
site]</a>. SoundTouch is used in float sample mode. These settings might however
be exposed in a later version.</p>
<p><b>Examples:</b></p>
<pre>TimeStretch(pitch = 200) </pre>
<p>This will raise the <var>pitch</var> one octave, while preserving the length
of the original sample.</p>
<pre>TimeStretch(tempo = (100.0*25.0)/23.976)</pre>
<p>This will change the <var>tempo</var> from Film speed to PAL speed without
changing the pitch.</p>
<p><b>Credits:</b></p>
<p>This function uses:</p>
<p>SoundTouch library Copyright (c) Olli Parviainen 2002-2003</p>
<p><a href="http://www.iki.fi/oparviai/soundtouch">http://www.iki.fi/oparviai/soundtouch</a></p>
<p><b>Changelog:</b></p>
<table border="1">
  <tbody>
    <tr>
      <td>v2.55</td>
      <td>Initial Release</td>
    </tr>
  </tbody>
</table>

<p><kbd>$Date: 2005/10/03 16:31:31 $</kbd></p>
<form>
  <p><input TYPE="Button" VALUE="Back"
onClick="history.go(-1)"></p>
</form>

</body>
</html>
